package com.lagou.edu.controller;

import com.lagou.edu.pojo.Result;
import com.lagou.edu.service.EmailService;
import com.lagou.edu.utils.LagouUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.MailSender;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 梅松
 * @Date 2021/10/17 11:24
 */
@RestController
@RequestMapping("/email")
public class EmailController {
    @Autowired
    private EmailService emailService;

    @RequestMapping("/email/{email}/{code}/{expire_time}")
    public Result<Boolean> email(@PathVariable String email, @PathVariable String code,@PathVariable int expire_time){
        //1、发送邮件
        return Result.ok(emailService.sendSimpleEmail(email,code,expire_time));
    }

}
